//
//  MSQuarterReportFormViewController.m
//  觅尚
//
//  Created by No.8 on 2019/4/3.
//  Copyright © 2019 No.8. All rights reserved.
//

#import "MSDayReportFormController.h"

#import "MSHomeCell.h"



@interface MSDayReportFormController ()<UITableViewDataSource,UITableViewDelegate>
/** 表视图*/
@property(nonatomic,strong)UITableView *tableView;

/** accountingMoney*/
@property(nonatomic,strong)NSString *accountingMoney;


/** aliPay*/
@property(nonatomic,strong)NSString *aliPay;

/** bankCardPay*/
@property(nonatomic,strong)NSString *bankCardPay;


/** cashPay*/
@property(nonatomic,strong)NSString *cashPay;

/** memberCardMoney*/
@property(nonatomic,strong)NSString *memberCardMoney;

/** membershipPay*/
@property(nonatomic,strong)NSString *membershipPay;

/** otherMembershipMoney*/
@property(nonatomic,strong)NSString *otherMembershipMoney;


/** otherMoney*/
@property(nonatomic,strong)NSString *otherMoney;

/** otheraliPay*/
@property(nonatomic,strong)NSString *otheraliPay;


/** otherbankCardPay*/
@property(nonatomic,strong)NSString *otherbankCardPay;

/** othercashPay*/
@property(nonatomic,strong)NSString *othercashPay;


/** otherweChat*/
@property(nonatomic,strong)NSString *otherweChat;


/** repaymentMoney*/
@property(nonatomic,strong)NSString *repaymentMoney;

/** rewardMoney*/
@property(nonatomic,strong)NSString *rewardMoney;

/** totalIncome*/
@property(nonatomic,strong)NSString *totalIncome;

/** weChat*/
@property(nonatomic,strong)NSString *weChat;

/** weChatPay*/
@property(nonatomic,strong)NSString *weChatPay;

/** updateTime*/
@property(nonatomic,strong)NSString *updateTime;

/** <#name#>*/
@property(nonatomic,strong)NSString  *statisticalTime;



@end

@implementation MSDayReportFormController
- (int)navBarBottom {
    if ([WRNavigationBar isIphoneX]) {
        return 88;
    } else {
        return 64;
    }
}
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:YES];
    self.navigationController.navigationBar.hidden = YES;
    
    Prepare *header = [Prepare headerWithRefreshingTarget:self refreshingAction:@selector(MJChiBaoZiHeaderRefresh)];
    // 隐藏时间
    header.lastUpdatedTimeLabel.hidden = YES;
    header.stateLabel.hidden = YES;
    // 马上进入刷新状态
    self.tableView.mj_header = header;
    [self.tableView.mj_header beginRefreshing];
}
- (void)MJChiBaoZiHeaderRefresh{
    //    [self.tableView.header beginRefreshing];
    //    [self loadShowproduct];
    [self ReloadData];
    
}
- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:YES];
    self.navigationController.navigationBar.hidden = YES;
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self tableView];
    
    self.view.backgroundColor = WYCRGBColor(20, 33, 48);
}

/** 表视图*/
- (UITableView *)tableView{
    self.extendedLayoutIncludesOpaqueBars = YES;
    if (!_tableView) {
        
        if (@available(iOS 11.0, *)) {
            
            _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
            
        } else {
            
            self.automaticallyAdjustsScrollViewInsets = NO;
            
        }
        _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight - [self navBarBottom] - 100 * px) style:UITableViewStyleGrouped];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.backgroundColor = [UIColor clearColor];
        _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        [self.view addSubview:self.tableView];
    }
    return _tableView;
}
- (void)ReloadData{
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    
    [formatter setDateFormat:@"YYYY-MM-dd"];
    
    NSDate *datenow = [NSDate date];
    
    NSString *currentTimeString = [formatter stringFromDate:datenow];
    NSDictionary * params = @{@"busId":[WYCAccountTool unarchivebelongBusid],@"queryTime":@"day",@"Time":currentTimeString};
    [HTTPRequest POST:MSgetBussinessIncome params:params succeed:^(id responseObject) {
        WYCLog(@"----------%@",responseObject);
        if (CodeStr) {
            
            [self.tableView.mj_header endRefreshing];
            
            
            self.accountingMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"accountingMoney"]];
            self.aliPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"aliPay"]];
            self.bankCardPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"bankCardPay"]];
            self.cashPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"cashPay"]];
            self.memberCardMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"memberCardMoney"]];
            self.membershipPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"membershipPay"]];
            self.otherMembershipMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"otherMembershipMoney"]];
            self.otherMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"otherMoney"]];
            self.otheraliPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"otheraliPay"]];
            self.otherbankCardPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"otherbankCardPay"]];
            self.othercashPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"othercashPay"]];
            self.otherweChat = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"otherweChat"]];
            self.repaymentMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"repaymentMoney"]];
            self.rewardMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"rewardMoney"]];
            self.totalIncome = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"totalIncome"]];
            self.weChat = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"weChat"]];
            self.weChatPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"weChatPay"]];
            self.weChatPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"weChatPay"]];
            self.statisticalTime = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"statisticalTime"]];
            self.updateTime = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"updateTime"]];
        }else{
            [self.tableView.mj_header endRefreshing];
            [MBManager showBriefAlert:responseObject[@"msg"]];
        }
        [self.tableView reloadData];
    } failure:^(NSError *error) {
        [self.tableView.mj_header endRefreshing];
        [MBManager showBriefAlert:Failed];
    }];
    
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 5;
}
// 返回组头部view的高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    
    return 230 * px;
    
}


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if (indexPath.row == 0) {
        return 400 * px;
    }else if (indexPath.row == 3){
        return 470 * px;
    }else{
        return 300 * px;
    }
}
//返回每组头部view

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    
    UIView *headerView = [[UIView alloc]init];
    
    headerView.backgroundColor = WYCRGBColor(20, 33, 48);
    
    //标题
    UILabel * Titlelabel = [[UILabel alloc] initWithFrame:CGRectMake(30 * px, 30 * px, ScreenWidth, 60 * px)];
    Titlelabel.textColor = [UIColor grayColor];
    Titlelabel.text = [NSString stringWithFormat:@"%@",self.statisticalTime];
    Titlelabel.font = [UIFont boldSystemFontOfSize:SYRealValue(26 / 2)];
    [headerView addSubview:Titlelabel];
    
    //时间图片
    UIImageView *TimeIMG = [[UIImageView alloc] initWithFrame:CGRectMake(Titlelabel.x, CGRectGetMaxY(Titlelabel.frame) + 20 * px, 50 * px, 50 * px)];
    TimeIMG.image = [UIImage imageNamed:@"gxxj_icon"];
    [headerView addSubview:TimeIMG];
    
    
    
    
    //时间
    UILabel * Timelabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(TimeIMG.frame) + 10 * px, TimeIMG.y, 350 * px, 50 * px)];
    Timelabel.textColor = WYCRGBColor(139, 149, 171);
    Timelabel.font = [UIFont boldSystemFontOfSize:SYRealValue(26 / 2)];
    Timelabel.text = [NSString stringWithFormat:@"%@",self.updateTime];;
    [headerView addSubview:Timelabel];
    
    
    return headerView;
    
}



- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    
    MSHomeCell * cell = [MSHomeCell cellWithTableView:tableView];
    tableView.backgroundColor = [UIColor clearColor];
    //无色
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
        
        cell.contentView.backgroundColor = WYCRGBColor(20, 33, 48);
        if (indexPath.row == 0) {
            UIView *CellView = [[UIView alloc]init];
            CellView.frame = CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 400 * px);
            CellView.backgroundColor = WYCRGBColor(45, 54, 70);
            //            CellView.cornerRadius = 20 * px;
            // 左上和右上为圆角
            
            UIBezierPath *cornerRadiusPath = [UIBezierPath bezierPathWithRoundedRect:CellView.bounds byRoundingCorners:UIRectCornerTopRight | UIRectCornerTopLeft cornerRadii:CGSizeMake(20 * px, 20 * px)];
            CAShapeLayer *cornerRadiusLayer = [ [CAShapeLayer alloc ] init];
            cornerRadiusLayer.frame = CellView.bounds;
            cornerRadiusLayer.path = cornerRadiusPath.CGPath;
            CellView.layer.mask = cornerRadiusLayer;
            [cell.contentView addSubview:CellView];
            
            
            UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, CellView.height - 0.5, CellView.width, 0.5)];
            line.backgroundColor = WYCRGBColor(55, 63, 84);
            [CellView addSubview:line];
            
            UIImageView * photoIMG = [[UIImageView alloc] initWithFrame:CGRectMake(60 * px, 80 * px, 80 * px, 80 * px)];
            photoIMG.image = [UIImage imageNamed:@"syze_icon"];
            [CellView addSubview:photoIMG];
            
            
            
            UILabel * CellTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(photoIMG.frame) + 30 * px, 30 * px, 260 * px, 60 * px)];
            CellTitleLabel.text = @"收益总额";
            CellTitleLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
            CellTitleLabel.textColor = [UIColor whiteColor];
            [CellView addSubview:CellTitleLabel];
            
            
            
            UILabel * TotalLabel = [[UILabel alloc] initWithFrame:CGRectMake(CellTitleLabel.x, CGRectGetMaxY(CellTitleLabel.frame) + 30 * px, ScreenWidth * 0.8, 70 * px)];
            TotalLabel.text = [NSString stringWithFormat:@"￥%@",self.totalIncome];
            TotalLabel.font = [UIFont systemFontOfSize:SYRealValue(64 / 2)];;
            TotalLabel.textColor = FontColor;
            [CellView addSubview:TotalLabel];
            
            
            UILabel * CashLabel = [[UILabel alloc] initWithFrame:CGRectMake(TotalLabel.x, CGRectGetMaxY(TotalLabel.frame) + 30 * px, CellView.width * 0.3, 50 * px)];
            CashLabel.text = [NSString stringWithFormat:@"现金:%@",self.cashPay];
            CashLabel.font = [UIFont systemFontOfSize:SYRealValue(24 / 2)];
            CashLabel.textColor = WYCRGBColor(141,153,178);
            [CellView addSubview:CashLabel];
            
            
            UILabel * WxchatLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(CashLabel.frame) + 30 * px, CashLabel.y, CashLabel.width, CashLabel.height)];
            WxchatLabel.text = [NSString stringWithFormat:@"微信:%@",self.weChat];
            WxchatLabel.font = CashLabel.font;
            WxchatLabel.textColor = CashLabel.textColor;
            [CellView addSubview:WxchatLabel];
            
            
            UILabel * PayCardLabel = [[UILabel alloc] initWithFrame:CGRectMake(CashLabel.x, CGRectGetMaxY(CashLabel.frame) + 30 * px, CashLabel.width, CashLabel.height)];
            PayCardLabel.text = [NSString stringWithFormat:@"刷卡:%@",self.bankCardPay];
            PayCardLabel.font = CashLabel.font;
            PayCardLabel.textColor = CashLabel.textColor;
            [CellView addSubview:PayCardLabel];
            
            
            UILabel * AlipayLabel = [[UILabel alloc] initWithFrame:CGRectMake(WxchatLabel.x, PayCardLabel.y, CashLabel.width, CashLabel.height)];
            AlipayLabel.text = [NSString stringWithFormat:@"支付宝:%@",self.aliPay];
            AlipayLabel.font = CashLabel.font;
            AlipayLabel.textColor = CashLabel.textColor;
            [CellView addSubview:AlipayLabel];
        }else if (indexPath.row == 1){
            
            UIView *CellView = [[UIView alloc]init];
            CellView.frame = CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 300 * px);
            CellView.backgroundColor = WYCRGBColor(45, 54, 70);
            [cell.contentView addSubview:CellView];
            
            
            UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, CellView.height - 0.5, CellView.width, 0.5)];
            line.backgroundColor = WYCRGBColor(55, 63, 84);
            [CellView addSubview:line];
            
            UIImageView * VipIMG = [[UIImageView alloc] initWithFrame:CGRectMake(60 * px, 80 * px, 80 * px, 80 * px)];
            VipIMG.image = [UIImage imageNamed:@"hyk_icon"];
            [CellView addSubview:VipIMG];
            
            
            
            UILabel * CellTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(VipIMG.frame) + 30 * px, 30 * px, 260 * px, 60 * px)];
            CellTitleLabel.text = @"会员卡";
            CellTitleLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
            CellTitleLabel.textColor = [UIColor whiteColor];
            [CellView addSubview:CellTitleLabel];
            
            
            
            UILabel * RechargeLabel = [[UILabel alloc] initWithFrame:CGRectMake(CellTitleLabel.x, CGRectGetMaxY(CellTitleLabel.frame) + 30 * px, 600 * px, 50 * px)];
            RechargeLabel.text = [NSString stringWithFormat:@"充值入账:%@",self.memberCardMoney];
            RechargeLabel.font = [UIFont systemFontOfSize:SYRealValue(24 / 2)];
            RechargeLabel.textColor = WYCRGBColor(141,153,178);
            [CellView addSubview:RechargeLabel];
            
            
            UILabel * ConsumptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(CellTitleLabel.x, CGRectGetMaxY(RechargeLabel.frame) + 30 * px, RechargeLabel.width, RechargeLabel.height)];
            ConsumptionLabel.text = [NSString stringWithFormat:@"消费入账:%@",self.membershipPay];
            ConsumptionLabel.font = RechargeLabel.font;
            ConsumptionLabel.textColor = RechargeLabel.textColor;
            [CellView addSubview:ConsumptionLabel];
        }else if (indexPath.row == 2){
            
            UIView *CellView = [[UIView alloc]init];
            CellView.frame = CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 300 * px);
            CellView.backgroundColor = WYCRGBColor(45, 54, 70);
            [cell.contentView addSubview:CellView];
            
            
            UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, CellView.height - 0.5, CellView.width, 0.5)];
            line.backgroundColor = WYCRGBColor(55, 63, 84);
            [CellView addSubview:line];
            
            UIImageView * VipIMG = [[UIImageView alloc] initWithFrame:CGRectMake(60 * px, 80 * px, 80 * px, 80 * px)];
            VipIMG.image = [UIImage imageNamed:@"gzsj_icon"];
            [CellView addSubview:VipIMG];
            
            
            
            UILabel * CellTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(VipIMG.frame) + 30 * px, 30 * px, 260 * px, 60 * px)];
            CellTitleLabel.text = @"挂账数据";
            CellTitleLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
            CellTitleLabel.textColor = [UIColor whiteColor];
            [CellView addSubview:CellTitleLabel];
            
            
            
            UILabel * RepaymentLabel = [[UILabel alloc] initWithFrame:CGRectMake(CellTitleLabel.x, CGRectGetMaxY(CellTitleLabel.frame) + 30 * px, 600 * px, 50 * px)];
            RepaymentLabel.text = [NSString stringWithFormat:@"今日挂账还款:%@",self.repaymentMoney];
            RepaymentLabel.font = [UIFont systemFontOfSize:SYRealValue(24 / 2)];
            RepaymentLabel.textColor = WYCRGBColor(141,153,178);
            [CellView addSubview:RepaymentLabel];
            
            
            UILabel * RepaymentamountLabel = [[UILabel alloc] initWithFrame:CGRectMake(CellTitleLabel.x, CGRectGetMaxY(RepaymentLabel.frame) + 30 * px, RepaymentLabel.width, RepaymentLabel.height)];
            RepaymentamountLabel.text = [NSString stringWithFormat:@"今日挂账额:%@",self.accountingMoney];
            RepaymentamountLabel.font = RepaymentLabel.font;
            RepaymentamountLabel.textColor = RepaymentLabel.textColor;
            [CellView addSubview:RepaymentamountLabel];
            
        }else if (indexPath.row == 3) {
            UIView *CellView = [[UIView alloc]init];
            CellView.frame = CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 470 * px);
            CellView.backgroundColor = WYCRGBColor(45, 54, 70);
            [cell.contentView addSubview:CellView];
            
            
            UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, CellView.height - 0.5, CellView.width, 0.5)];
            line.backgroundColor = WYCRGBColor(55, 63, 84);
            [CellView addSubview:line];
            
            UIImageView * photoIMG = [[UIImageView alloc] initWithFrame:CGRectMake(60 * px, 80 * px, 80 * px, 80 * px)];
            photoIMG.image = [UIImage imageNamed:@"qtsy_icon"];
            [CellView addSubview:photoIMG];
            
            
            
            UILabel * CellTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(photoIMG.frame) + 30 * px, 30 * px, 360 * px, 60 * px)];
            CellTitleLabel.text = @"其他收益额";
            CellTitleLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
            CellTitleLabel.textColor = [UIColor whiteColor];
            [CellView addSubview:CellTitleLabel];
            
            
            
            UILabel * TotalLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(photoIMG.frame) + 30 * px, CGRectGetMaxY(CellTitleLabel.frame) + 30 * px, ScreenWidth * 0.8, 70 * px)];
            TotalLabel.text = [NSString stringWithFormat:@"￥%@",self.otherMoney];
            TotalLabel.font = [UIFont boldSystemFontOfSize:SYRealValue(64 / 2)];
            TotalLabel.textColor = FontColor;
            [CellView addSubview:TotalLabel];
            
            
            UILabel * CashLabel = [[UILabel alloc] initWithFrame:CGRectMake(TotalLabel.x, CGRectGetMaxY(TotalLabel.frame) + 30 * px, CellView.width * 0.3, 50 * px)];
            CashLabel.text = [NSString stringWithFormat:@"现金:%@",self.othercashPay];
            CashLabel.font = [UIFont systemFontOfSize:SYRealValue(24 / 2)];
            CashLabel.textColor = WYCRGBColor(141,153,178);
            [CellView addSubview:CashLabel];
            
            
            UILabel * WxchatLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(CashLabel.frame) + 30 * px, CashLabel.y, CashLabel.width, CashLabel.height)];
            WxchatLabel.text = [NSString stringWithFormat:@"微信:%@",self.otherweChat];
            WxchatLabel.font = CashLabel.font;
            WxchatLabel.textColor = CashLabel.textColor;
            [CellView addSubview:WxchatLabel];
            
            
            UILabel * shuakaLabel = [[UILabel alloc] initWithFrame:CGRectMake(CashLabel.x, CGRectGetMaxY(CashLabel.frame) + 30 * px, CashLabel.width , CashLabel.height)];
            shuakaLabel.text = [NSString stringWithFormat:@"刷卡:%@",self.otherbankCardPay];
            shuakaLabel.font = CashLabel.font;
            shuakaLabel.textColor = CashLabel.textColor;
            [CellView addSubview:shuakaLabel];
            
            
            UILabel * ZhifubaoLabel = [[UILabel alloc] initWithFrame:CGRectMake(WxchatLabel.x, shuakaLabel.y, CashLabel.width, CashLabel.height)];
            ZhifubaoLabel.text = [NSString stringWithFormat:@"支付宝:%@",self.otheraliPay];
            ZhifubaoLabel.font = CashLabel.font;
            ZhifubaoLabel.textColor = CashLabel.textColor;
            [CellView addSubview:ZhifubaoLabel];
            
            UILabel * HuiyuankaLabel = [[UILabel alloc] initWithFrame:CGRectMake(shuakaLabel.x, CGRectGetMaxY(shuakaLabel.frame) + 30 * px, shuakaLabel.width, shuakaLabel.height)];
            HuiyuankaLabel.text = [NSString stringWithFormat:@"会员卡支付:%@",self.otherMembershipMoney];
            HuiyuankaLabel.font = CashLabel.font;
            HuiyuankaLabel.textColor = CashLabel.textColor;
            [CellView addSubview:HuiyuankaLabel];
            
        
        }else{
            UIView *CellView = [[UIView alloc]init];
            CellView.frame = CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 300 * px);
            CellView.backgroundColor = BackViewColor;
            
            
            UIBezierPath *cornerRadiusPath = [UIBezierPath bezierPathWithRoundedRect:CellView.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(20 * px, 20 * px)];
            CAShapeLayer *cornerRadiusLayer = [ [CAShapeLayer alloc ] init];
            cornerRadiusLayer.frame = CellView.bounds;
            cornerRadiusLayer.path = cornerRadiusPath.CGPath;
            CellView.layer.mask = cornerRadiusLayer;
            [cell.contentView addSubview:CellView];
            
            
            UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, CellView.height - 0.5, CellView.width, 0.5)];
            line.backgroundColor = WYCRGBColor(55, 63, 84);
            [CellView addSubview:line];
            
            UIImageView * photoIMG = [[UIImageView alloc] initWithFrame:CGRectMake(60 * px, 80 * px, 80 * px, 80 * px)];
            photoIMG.image = [UIImage imageNamed:@"zdfy_icon"];
            [CellView addSubview:photoIMG];
            
            
            
            UILabel * CellTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(photoIMG.frame) + 30 * px, 30 * px, 260 * px, 60 * px)];
            CellTitleLabel.text = @"招待费用";
            CellTitleLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
            CellTitleLabel.textColor = [UIColor whiteColor];
            [CellView addSubview:CellTitleLabel];
            
            
            
            UILabel * TotalLabel = [[UILabel alloc] initWithFrame:CGRectMake(CellTitleLabel.x, CGRectGetMaxY(CellTitleLabel.frame) + 30 * px, ScreenWidth * 0.8, 70 * px)];
            TotalLabel.text = [NSString stringWithFormat:@"¥%@",self.rewardMoney];
            TotalLabel.font = [UIFont systemFontOfSize:SYRealValue(64 / 2)];
            TotalLabel.textColor = WYCRGBColor(41,147,242);
            [CellView addSubview:TotalLabel];
            
        
    }
    return cell;
}

@end
